#pragma once
// MESSAGE MISSION_HEARTBEAT_5HZ PACKING

#define MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ 12922


typedef struct __mavlink_mission_heartbeat_5hz_t {
 int64_t seq; /*<  seq序列号*/
 int32_t uav_lat; /*<  uav纬度 = uav_lat * 1e-7*/
 int32_t uav_lon; /*<  uav点经度 = home_y_lon * 1e-7*/
 int32_t uav_alt; /*<  uav高度 = home_z_alt * 1e-3*/
 int32_t gps_num; /*<  卫星数*/
 int32_t gps_fix; /*<  定位状态*/
 int32_t roll; /*<  滚转角*/
 int32_t pitch; /*<  俯仰角*/
 int32_t yaw; /*<  航向角*/
 int32_t pos_x; /*<  ned位置*/
 int32_t pos_y; /*<  ned位置*/
 int32_t pos_z; /*<  ned位置*/
 int32_t vel_x; /*<  ned速度*/
 int32_t vel_y; /*<  ned速度*/
 int32_t vel_z; /*<  ned速度*/
 int32_t distance_mm; /*<  飞行距离m = distance_m * 1e-3*/
 uint8_t drone_type; /*<  飞机类型 DroneType*/
 uint8_t drone_id; /*<  飞机id*/
 uint8_t is_gps_invalid; /*<  gps是否有效*/
} mavlink_mission_heartbeat_5hz_t;

#define MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN 71
#define MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_MIN_LEN 71
#define MAVLINK_MSG_ID_12922_LEN 71
#define MAVLINK_MSG_ID_12922_MIN_LEN 71

#define MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_CRC 116
#define MAVLINK_MSG_ID_12922_CRC 116



#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_MISSION_HEARTBEAT_5HZ { \
    12922, \
    "MISSION_HEARTBEAT_5HZ", \
    19, \
    {  { "seq", NULL, MAVLINK_TYPE_INT64_T, 0, 0, offsetof(mavlink_mission_heartbeat_5hz_t, seq) }, \
         { "drone_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 68, offsetof(mavlink_mission_heartbeat_5hz_t, drone_type) }, \
         { "drone_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 69, offsetof(mavlink_mission_heartbeat_5hz_t, drone_id) }, \
         { "is_gps_invalid", NULL, MAVLINK_TYPE_UINT8_T, 0, 70, offsetof(mavlink_mission_heartbeat_5hz_t, is_gps_invalid) }, \
         { "uav_lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_mission_heartbeat_5hz_t, uav_lat) }, \
         { "uav_lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_mission_heartbeat_5hz_t, uav_lon) }, \
         { "uav_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_mission_heartbeat_5hz_t, uav_alt) }, \
         { "gps_num", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_mission_heartbeat_5hz_t, gps_num) }, \
         { "gps_fix", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_mission_heartbeat_5hz_t, gps_fix) }, \
         { "roll", NULL, MAVLINK_TYPE_INT32_T, 0, 28, offsetof(mavlink_mission_heartbeat_5hz_t, roll) }, \
         { "pitch", NULL, MAVLINK_TYPE_INT32_T, 0, 32, offsetof(mavlink_mission_heartbeat_5hz_t, pitch) }, \
         { "yaw", NULL, MAVLINK_TYPE_INT32_T, 0, 36, offsetof(mavlink_mission_heartbeat_5hz_t, yaw) }, \
         { "pos_x", NULL, MAVLINK_TYPE_INT32_T, 0, 40, offsetof(mavlink_mission_heartbeat_5hz_t, pos_x) }, \
         { "pos_y", NULL, MAVLINK_TYPE_INT32_T, 0, 44, offsetof(mavlink_mission_heartbeat_5hz_t, pos_y) }, \
         { "pos_z", NULL, MAVLINK_TYPE_INT32_T, 0, 48, offsetof(mavlink_mission_heartbeat_5hz_t, pos_z) }, \
         { "vel_x", NULL, MAVLINK_TYPE_INT32_T, 0, 52, offsetof(mavlink_mission_heartbeat_5hz_t, vel_x) }, \
         { "vel_y", NULL, MAVLINK_TYPE_INT32_T, 0, 56, offsetof(mavlink_mission_heartbeat_5hz_t, vel_y) }, \
         { "vel_z", NULL, MAVLINK_TYPE_INT32_T, 0, 60, offsetof(mavlink_mission_heartbeat_5hz_t, vel_z) }, \
         { "distance_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 64, offsetof(mavlink_mission_heartbeat_5hz_t, distance_mm) }, \
         } \
}
#else
#define MAVLINK_MESSAGE_INFO_MISSION_HEARTBEAT_5HZ { \
    "MISSION_HEARTBEAT_5HZ", \
    19, \
    {  { "seq", NULL, MAVLINK_TYPE_INT64_T, 0, 0, offsetof(mavlink_mission_heartbeat_5hz_t, seq) }, \
         { "drone_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 68, offsetof(mavlink_mission_heartbeat_5hz_t, drone_type) }, \
         { "drone_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 69, offsetof(mavlink_mission_heartbeat_5hz_t, drone_id) }, \
         { "is_gps_invalid", NULL, MAVLINK_TYPE_UINT8_T, 0, 70, offsetof(mavlink_mission_heartbeat_5hz_t, is_gps_invalid) }, \
         { "uav_lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_mission_heartbeat_5hz_t, uav_lat) }, \
         { "uav_lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_mission_heartbeat_5hz_t, uav_lon) }, \
         { "uav_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_mission_heartbeat_5hz_t, uav_alt) }, \
         { "gps_num", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_mission_heartbeat_5hz_t, gps_num) }, \
         { "gps_fix", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_mission_heartbeat_5hz_t, gps_fix) }, \
         { "roll", NULL, MAVLINK_TYPE_INT32_T, 0, 28, offsetof(mavlink_mission_heartbeat_5hz_t, roll) }, \
         { "pitch", NULL, MAVLINK_TYPE_INT32_T, 0, 32, offsetof(mavlink_mission_heartbeat_5hz_t, pitch) }, \
         { "yaw", NULL, MAVLINK_TYPE_INT32_T, 0, 36, offsetof(mavlink_mission_heartbeat_5hz_t, yaw) }, \
         { "pos_x", NULL, MAVLINK_TYPE_INT32_T, 0, 40, offsetof(mavlink_mission_heartbeat_5hz_t, pos_x) }, \
         { "pos_y", NULL, MAVLINK_TYPE_INT32_T, 0, 44, offsetof(mavlink_mission_heartbeat_5hz_t, pos_y) }, \
         { "pos_z", NULL, MAVLINK_TYPE_INT32_T, 0, 48, offsetof(mavlink_mission_heartbeat_5hz_t, pos_z) }, \
         { "vel_x", NULL, MAVLINK_TYPE_INT32_T, 0, 52, offsetof(mavlink_mission_heartbeat_5hz_t, vel_x) }, \
         { "vel_y", NULL, MAVLINK_TYPE_INT32_T, 0, 56, offsetof(mavlink_mission_heartbeat_5hz_t, vel_y) }, \
         { "vel_z", NULL, MAVLINK_TYPE_INT32_T, 0, 60, offsetof(mavlink_mission_heartbeat_5hz_t, vel_z) }, \
         { "distance_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 64, offsetof(mavlink_mission_heartbeat_5hz_t, distance_mm) }, \
         } \
}
#endif

/**
 * @brief Pack a mission_heartbeat_5hz message
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 *
 * @param seq  seq序列号
 * @param drone_type  飞机类型 DroneType
 * @param drone_id  飞机id
 * @param is_gps_invalid  gps是否有效
 * @param uav_lat  uav纬度 = uav_lat * 1e-7
 * @param uav_lon  uav点经度 = home_y_lon * 1e-7
 * @param uav_alt  uav高度 = home_z_alt * 1e-3
 * @param gps_num  卫星数
 * @param gps_fix  定位状态
 * @param roll  滚转角
 * @param pitch  俯仰角
 * @param yaw  航向角
 * @param pos_x  ned位置
 * @param pos_y  ned位置
 * @param pos_z  ned位置
 * @param vel_x  ned速度
 * @param vel_y  ned速度
 * @param vel_z  ned速度
 * @param distance_mm  飞行距离m = distance_m * 1e-3
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_mission_heartbeat_5hz_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
                               int64_t seq, uint8_t drone_type, uint8_t drone_id, uint8_t is_gps_invalid, int32_t uav_lat, int32_t uav_lon, int32_t uav_alt, int32_t gps_num, int32_t gps_fix, int32_t roll, int32_t pitch, int32_t yaw, int32_t pos_x, int32_t pos_y, int32_t pos_z, int32_t vel_x, int32_t vel_y, int32_t vel_z, int32_t distance_mm)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN];
    _mav_put_int64_t(buf, 0, seq);
    _mav_put_int32_t(buf, 8, uav_lat);
    _mav_put_int32_t(buf, 12, uav_lon);
    _mav_put_int32_t(buf, 16, uav_alt);
    _mav_put_int32_t(buf, 20, gps_num);
    _mav_put_int32_t(buf, 24, gps_fix);
    _mav_put_int32_t(buf, 28, roll);
    _mav_put_int32_t(buf, 32, pitch);
    _mav_put_int32_t(buf, 36, yaw);
    _mav_put_int32_t(buf, 40, pos_x);
    _mav_put_int32_t(buf, 44, pos_y);
    _mav_put_int32_t(buf, 48, pos_z);
    _mav_put_int32_t(buf, 52, vel_x);
    _mav_put_int32_t(buf, 56, vel_y);
    _mav_put_int32_t(buf, 60, vel_z);
    _mav_put_int32_t(buf, 64, distance_mm);
    _mav_put_uint8_t(buf, 68, drone_type);
    _mav_put_uint8_t(buf, 69, drone_id);
    _mav_put_uint8_t(buf, 70, is_gps_invalid);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN);
#else
    mavlink_mission_heartbeat_5hz_t packet;
    packet.seq = seq;
    packet.uav_lat = uav_lat;
    packet.uav_lon = uav_lon;
    packet.uav_alt = uav_alt;
    packet.gps_num = gps_num;
    packet.gps_fix = gps_fix;
    packet.roll = roll;
    packet.pitch = pitch;
    packet.yaw = yaw;
    packet.pos_x = pos_x;
    packet.pos_y = pos_y;
    packet.pos_z = pos_z;
    packet.vel_x = vel_x;
    packet.vel_y = vel_y;
    packet.vel_z = vel_z;
    packet.distance_mm = distance_mm;
    packet.drone_type = drone_type;
    packet.drone_id = drone_id;
    packet.is_gps_invalid = is_gps_invalid;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ;
    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_MIN_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_CRC);
}

/**
 * @brief Pack a mission_heartbeat_5hz message
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param status MAVLink status structure
 * @param msg The MAVLink message to compress the data into
 *
 * @param seq  seq序列号
 * @param drone_type  飞机类型 DroneType
 * @param drone_id  飞机id
 * @param is_gps_invalid  gps是否有效
 * @param uav_lat  uav纬度 = uav_lat * 1e-7
 * @param uav_lon  uav点经度 = home_y_lon * 1e-7
 * @param uav_alt  uav高度 = home_z_alt * 1e-3
 * @param gps_num  卫星数
 * @param gps_fix  定位状态
 * @param roll  滚转角
 * @param pitch  俯仰角
 * @param yaw  航向角
 * @param pos_x  ned位置
 * @param pos_y  ned位置
 * @param pos_z  ned位置
 * @param vel_x  ned速度
 * @param vel_y  ned速度
 * @param vel_z  ned速度
 * @param distance_mm  飞行距离m = distance_m * 1e-3
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_mission_heartbeat_5hz_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
                               int64_t seq, uint8_t drone_type, uint8_t drone_id, uint8_t is_gps_invalid, int32_t uav_lat, int32_t uav_lon, int32_t uav_alt, int32_t gps_num, int32_t gps_fix, int32_t roll, int32_t pitch, int32_t yaw, int32_t pos_x, int32_t pos_y, int32_t pos_z, int32_t vel_x, int32_t vel_y, int32_t vel_z, int32_t distance_mm)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN];
    _mav_put_int64_t(buf, 0, seq);
    _mav_put_int32_t(buf, 8, uav_lat);
    _mav_put_int32_t(buf, 12, uav_lon);
    _mav_put_int32_t(buf, 16, uav_alt);
    _mav_put_int32_t(buf, 20, gps_num);
    _mav_put_int32_t(buf, 24, gps_fix);
    _mav_put_int32_t(buf, 28, roll);
    _mav_put_int32_t(buf, 32, pitch);
    _mav_put_int32_t(buf, 36, yaw);
    _mav_put_int32_t(buf, 40, pos_x);
    _mav_put_int32_t(buf, 44, pos_y);
    _mav_put_int32_t(buf, 48, pos_z);
    _mav_put_int32_t(buf, 52, vel_x);
    _mav_put_int32_t(buf, 56, vel_y);
    _mav_put_int32_t(buf, 60, vel_z);
    _mav_put_int32_t(buf, 64, distance_mm);
    _mav_put_uint8_t(buf, 68, drone_type);
    _mav_put_uint8_t(buf, 69, drone_id);
    _mav_put_uint8_t(buf, 70, is_gps_invalid);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN);
#else
    mavlink_mission_heartbeat_5hz_t packet;
    packet.seq = seq;
    packet.uav_lat = uav_lat;
    packet.uav_lon = uav_lon;
    packet.uav_alt = uav_alt;
    packet.gps_num = gps_num;
    packet.gps_fix = gps_fix;
    packet.roll = roll;
    packet.pitch = pitch;
    packet.yaw = yaw;
    packet.pos_x = pos_x;
    packet.pos_y = pos_y;
    packet.pos_z = pos_z;
    packet.vel_x = vel_x;
    packet.vel_y = vel_y;
    packet.vel_z = vel_z;
    packet.distance_mm = distance_mm;
    packet.drone_type = drone_type;
    packet.drone_id = drone_id;
    packet.is_gps_invalid = is_gps_invalid;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ;
#if MAVLINK_CRC_EXTRA
    return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_MIN_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_CRC);
#else
    return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_MIN_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN);
#endif
}

/**
 * @brief Pack a mission_heartbeat_5hz message on a channel
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param seq  seq序列号
 * @param drone_type  飞机类型 DroneType
 * @param drone_id  飞机id
 * @param is_gps_invalid  gps是否有效
 * @param uav_lat  uav纬度 = uav_lat * 1e-7
 * @param uav_lon  uav点经度 = home_y_lon * 1e-7
 * @param uav_alt  uav高度 = home_z_alt * 1e-3
 * @param gps_num  卫星数
 * @param gps_fix  定位状态
 * @param roll  滚转角
 * @param pitch  俯仰角
 * @param yaw  航向角
 * @param pos_x  ned位置
 * @param pos_y  ned位置
 * @param pos_z  ned位置
 * @param vel_x  ned速度
 * @param vel_y  ned速度
 * @param vel_z  ned速度
 * @param distance_mm  飞行距离m = distance_m * 1e-3
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_mission_heartbeat_5hz_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
                               mavlink_message_t* msg,
                                   int64_t seq,uint8_t drone_type,uint8_t drone_id,uint8_t is_gps_invalid,int32_t uav_lat,int32_t uav_lon,int32_t uav_alt,int32_t gps_num,int32_t gps_fix,int32_t roll,int32_t pitch,int32_t yaw,int32_t pos_x,int32_t pos_y,int32_t pos_z,int32_t vel_x,int32_t vel_y,int32_t vel_z,int32_t distance_mm)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN];
    _mav_put_int64_t(buf, 0, seq);
    _mav_put_int32_t(buf, 8, uav_lat);
    _mav_put_int32_t(buf, 12, uav_lon);
    _mav_put_int32_t(buf, 16, uav_alt);
    _mav_put_int32_t(buf, 20, gps_num);
    _mav_put_int32_t(buf, 24, gps_fix);
    _mav_put_int32_t(buf, 28, roll);
    _mav_put_int32_t(buf, 32, pitch);
    _mav_put_int32_t(buf, 36, yaw);
    _mav_put_int32_t(buf, 40, pos_x);
    _mav_put_int32_t(buf, 44, pos_y);
    _mav_put_int32_t(buf, 48, pos_z);
    _mav_put_int32_t(buf, 52, vel_x);
    _mav_put_int32_t(buf, 56, vel_y);
    _mav_put_int32_t(buf, 60, vel_z);
    _mav_put_int32_t(buf, 64, distance_mm);
    _mav_put_uint8_t(buf, 68, drone_type);
    _mav_put_uint8_t(buf, 69, drone_id);
    _mav_put_uint8_t(buf, 70, is_gps_invalid);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN);
#else
    mavlink_mission_heartbeat_5hz_t packet;
    packet.seq = seq;
    packet.uav_lat = uav_lat;
    packet.uav_lon = uav_lon;
    packet.uav_alt = uav_alt;
    packet.gps_num = gps_num;
    packet.gps_fix = gps_fix;
    packet.roll = roll;
    packet.pitch = pitch;
    packet.yaw = yaw;
    packet.pos_x = pos_x;
    packet.pos_y = pos_y;
    packet.pos_z = pos_z;
    packet.vel_x = vel_x;
    packet.vel_y = vel_y;
    packet.vel_z = vel_z;
    packet.distance_mm = distance_mm;
    packet.drone_type = drone_type;
    packet.drone_id = drone_id;
    packet.is_gps_invalid = is_gps_invalid;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ;
    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_MIN_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_CRC);
}

/**
 * @brief Encode a mission_heartbeat_5hz struct
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 * @param mission_heartbeat_5hz C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_mission_heartbeat_5hz_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_heartbeat_5hz_t* mission_heartbeat_5hz)
{
    return mavlink_msg_mission_heartbeat_5hz_pack(system_id, component_id, msg, mission_heartbeat_5hz->seq, mission_heartbeat_5hz->drone_type, mission_heartbeat_5hz->drone_id, mission_heartbeat_5hz->is_gps_invalid, mission_heartbeat_5hz->uav_lat, mission_heartbeat_5hz->uav_lon, mission_heartbeat_5hz->uav_alt, mission_heartbeat_5hz->gps_num, mission_heartbeat_5hz->gps_fix, mission_heartbeat_5hz->roll, mission_heartbeat_5hz->pitch, mission_heartbeat_5hz->yaw, mission_heartbeat_5hz->pos_x, mission_heartbeat_5hz->pos_y, mission_heartbeat_5hz->pos_z, mission_heartbeat_5hz->vel_x, mission_heartbeat_5hz->vel_y, mission_heartbeat_5hz->vel_z, mission_heartbeat_5hz->distance_mm);
}

/**
 * @brief Encode a mission_heartbeat_5hz struct on a channel
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param mission_heartbeat_5hz C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_mission_heartbeat_5hz_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_heartbeat_5hz_t* mission_heartbeat_5hz)
{
    return mavlink_msg_mission_heartbeat_5hz_pack_chan(system_id, component_id, chan, msg, mission_heartbeat_5hz->seq, mission_heartbeat_5hz->drone_type, mission_heartbeat_5hz->drone_id, mission_heartbeat_5hz->is_gps_invalid, mission_heartbeat_5hz->uav_lat, mission_heartbeat_5hz->uav_lon, mission_heartbeat_5hz->uav_alt, mission_heartbeat_5hz->gps_num, mission_heartbeat_5hz->gps_fix, mission_heartbeat_5hz->roll, mission_heartbeat_5hz->pitch, mission_heartbeat_5hz->yaw, mission_heartbeat_5hz->pos_x, mission_heartbeat_5hz->pos_y, mission_heartbeat_5hz->pos_z, mission_heartbeat_5hz->vel_x, mission_heartbeat_5hz->vel_y, mission_heartbeat_5hz->vel_z, mission_heartbeat_5hz->distance_mm);
}

/**
 * @brief Encode a mission_heartbeat_5hz struct with provided status structure
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param status MAVLink status structure
 * @param msg The MAVLink message to compress the data into
 * @param mission_heartbeat_5hz C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_mission_heartbeat_5hz_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_mission_heartbeat_5hz_t* mission_heartbeat_5hz)
{
    return mavlink_msg_mission_heartbeat_5hz_pack_status(system_id, component_id, _status, msg,  mission_heartbeat_5hz->seq, mission_heartbeat_5hz->drone_type, mission_heartbeat_5hz->drone_id, mission_heartbeat_5hz->is_gps_invalid, mission_heartbeat_5hz->uav_lat, mission_heartbeat_5hz->uav_lon, mission_heartbeat_5hz->uav_alt, mission_heartbeat_5hz->gps_num, mission_heartbeat_5hz->gps_fix, mission_heartbeat_5hz->roll, mission_heartbeat_5hz->pitch, mission_heartbeat_5hz->yaw, mission_heartbeat_5hz->pos_x, mission_heartbeat_5hz->pos_y, mission_heartbeat_5hz->pos_z, mission_heartbeat_5hz->vel_x, mission_heartbeat_5hz->vel_y, mission_heartbeat_5hz->vel_z, mission_heartbeat_5hz->distance_mm);
}

/**
 * @brief Send a mission_heartbeat_5hz message
 * @param chan MAVLink channel to send the message
 *
 * @param seq  seq序列号
 * @param drone_type  飞机类型 DroneType
 * @param drone_id  飞机id
 * @param is_gps_invalid  gps是否有效
 * @param uav_lat  uav纬度 = uav_lat * 1e-7
 * @param uav_lon  uav点经度 = home_y_lon * 1e-7
 * @param uav_alt  uav高度 = home_z_alt * 1e-3
 * @param gps_num  卫星数
 * @param gps_fix  定位状态
 * @param roll  滚转角
 * @param pitch  俯仰角
 * @param yaw  航向角
 * @param pos_x  ned位置
 * @param pos_y  ned位置
 * @param pos_z  ned位置
 * @param vel_x  ned速度
 * @param vel_y  ned速度
 * @param vel_z  ned速度
 * @param distance_mm  飞行距离m = distance_m * 1e-3
 */
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS

static inline void mavlink_msg_mission_heartbeat_5hz_send(mavlink_channel_t chan, int64_t seq, uint8_t drone_type, uint8_t drone_id, uint8_t is_gps_invalid, int32_t uav_lat, int32_t uav_lon, int32_t uav_alt, int32_t gps_num, int32_t gps_fix, int32_t roll, int32_t pitch, int32_t yaw, int32_t pos_x, int32_t pos_y, int32_t pos_z, int32_t vel_x, int32_t vel_y, int32_t vel_z, int32_t distance_mm)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN];
    _mav_put_int64_t(buf, 0, seq);
    _mav_put_int32_t(buf, 8, uav_lat);
    _mav_put_int32_t(buf, 12, uav_lon);
    _mav_put_int32_t(buf, 16, uav_alt);
    _mav_put_int32_t(buf, 20, gps_num);
    _mav_put_int32_t(buf, 24, gps_fix);
    _mav_put_int32_t(buf, 28, roll);
    _mav_put_int32_t(buf, 32, pitch);
    _mav_put_int32_t(buf, 36, yaw);
    _mav_put_int32_t(buf, 40, pos_x);
    _mav_put_int32_t(buf, 44, pos_y);
    _mav_put_int32_t(buf, 48, pos_z);
    _mav_put_int32_t(buf, 52, vel_x);
    _mav_put_int32_t(buf, 56, vel_y);
    _mav_put_int32_t(buf, 60, vel_z);
    _mav_put_int32_t(buf, 64, distance_mm);
    _mav_put_uint8_t(buf, 68, drone_type);
    _mav_put_uint8_t(buf, 69, drone_id);
    _mav_put_uint8_t(buf, 70, is_gps_invalid);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ, buf, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_MIN_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_CRC);
#else
    mavlink_mission_heartbeat_5hz_t packet;
    packet.seq = seq;
    packet.uav_lat = uav_lat;
    packet.uav_lon = uav_lon;
    packet.uav_alt = uav_alt;
    packet.gps_num = gps_num;
    packet.gps_fix = gps_fix;
    packet.roll = roll;
    packet.pitch = pitch;
    packet.yaw = yaw;
    packet.pos_x = pos_x;
    packet.pos_y = pos_y;
    packet.pos_z = pos_z;
    packet.vel_x = vel_x;
    packet.vel_y = vel_y;
    packet.vel_z = vel_z;
    packet.distance_mm = distance_mm;
    packet.drone_type = drone_type;
    packet.drone_id = drone_id;
    packet.is_gps_invalid = is_gps_invalid;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ, (const char *)&packet, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_MIN_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_CRC);
#endif
}

/**
 * @brief Send a mission_heartbeat_5hz message
 * @param chan MAVLink channel to send the message
 * @param struct The MAVLink struct to serialize
 */
static inline void mavlink_msg_mission_heartbeat_5hz_send_struct(mavlink_channel_t chan, const mavlink_mission_heartbeat_5hz_t* mission_heartbeat_5hz)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    mavlink_msg_mission_heartbeat_5hz_send(chan, mission_heartbeat_5hz->seq, mission_heartbeat_5hz->drone_type, mission_heartbeat_5hz->drone_id, mission_heartbeat_5hz->is_gps_invalid, mission_heartbeat_5hz->uav_lat, mission_heartbeat_5hz->uav_lon, mission_heartbeat_5hz->uav_alt, mission_heartbeat_5hz->gps_num, mission_heartbeat_5hz->gps_fix, mission_heartbeat_5hz->roll, mission_heartbeat_5hz->pitch, mission_heartbeat_5hz->yaw, mission_heartbeat_5hz->pos_x, mission_heartbeat_5hz->pos_y, mission_heartbeat_5hz->pos_z, mission_heartbeat_5hz->vel_x, mission_heartbeat_5hz->vel_y, mission_heartbeat_5hz->vel_z, mission_heartbeat_5hz->distance_mm);
#else
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ, (const char *)mission_heartbeat_5hz, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_MIN_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_CRC);
#endif
}

#if MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
  This variant of _send() can be used to save stack space by re-using
  memory from the receive buffer.  The caller provides a
  mavlink_message_t which is the size of a full mavlink message. This
  is usually the receive buffer for the channel, and allows a reply to an
  incoming message with minimum stack space usage.
 */
static inline void mavlink_msg_mission_heartbeat_5hz_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  int64_t seq, uint8_t drone_type, uint8_t drone_id, uint8_t is_gps_invalid, int32_t uav_lat, int32_t uav_lon, int32_t uav_alt, int32_t gps_num, int32_t gps_fix, int32_t roll, int32_t pitch, int32_t yaw, int32_t pos_x, int32_t pos_y, int32_t pos_z, int32_t vel_x, int32_t vel_y, int32_t vel_z, int32_t distance_mm)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char *buf = (char *)msgbuf;
    _mav_put_int64_t(buf, 0, seq);
    _mav_put_int32_t(buf, 8, uav_lat);
    _mav_put_int32_t(buf, 12, uav_lon);
    _mav_put_int32_t(buf, 16, uav_alt);
    _mav_put_int32_t(buf, 20, gps_num);
    _mav_put_int32_t(buf, 24, gps_fix);
    _mav_put_int32_t(buf, 28, roll);
    _mav_put_int32_t(buf, 32, pitch);
    _mav_put_int32_t(buf, 36, yaw);
    _mav_put_int32_t(buf, 40, pos_x);
    _mav_put_int32_t(buf, 44, pos_y);
    _mav_put_int32_t(buf, 48, pos_z);
    _mav_put_int32_t(buf, 52, vel_x);
    _mav_put_int32_t(buf, 56, vel_y);
    _mav_put_int32_t(buf, 60, vel_z);
    _mav_put_int32_t(buf, 64, distance_mm);
    _mav_put_uint8_t(buf, 68, drone_type);
    _mav_put_uint8_t(buf, 69, drone_id);
    _mav_put_uint8_t(buf, 70, is_gps_invalid);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ, buf, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_MIN_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_CRC);
#else
    mavlink_mission_heartbeat_5hz_t *packet = (mavlink_mission_heartbeat_5hz_t *)msgbuf;
    packet->seq = seq;
    packet->uav_lat = uav_lat;
    packet->uav_lon = uav_lon;
    packet->uav_alt = uav_alt;
    packet->gps_num = gps_num;
    packet->gps_fix = gps_fix;
    packet->roll = roll;
    packet->pitch = pitch;
    packet->yaw = yaw;
    packet->pos_x = pos_x;
    packet->pos_y = pos_y;
    packet->pos_z = pos_z;
    packet->vel_x = vel_x;
    packet->vel_y = vel_y;
    packet->vel_z = vel_z;
    packet->distance_mm = distance_mm;
    packet->drone_type = drone_type;
    packet->drone_id = drone_id;
    packet->is_gps_invalid = is_gps_invalid;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ, (const char *)packet, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_MIN_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_CRC);
#endif
}
#endif

#endif

// MESSAGE MISSION_HEARTBEAT_5HZ UNPACKING


/**
 * @brief Get field seq from mission_heartbeat_5hz message
 *
 * @return  seq序列号
 */
static inline int64_t mavlink_msg_mission_heartbeat_5hz_get_seq(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int64_t(msg,  0);
}

/**
 * @brief Get field drone_type from mission_heartbeat_5hz message
 *
 * @return  飞机类型 DroneType
 */
static inline uint8_t mavlink_msg_mission_heartbeat_5hz_get_drone_type(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  68);
}

/**
 * @brief Get field drone_id from mission_heartbeat_5hz message
 *
 * @return  飞机id
 */
static inline uint8_t mavlink_msg_mission_heartbeat_5hz_get_drone_id(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  69);
}

/**
 * @brief Get field is_gps_invalid from mission_heartbeat_5hz message
 *
 * @return  gps是否有效
 */
static inline uint8_t mavlink_msg_mission_heartbeat_5hz_get_is_gps_invalid(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  70);
}

/**
 * @brief Get field uav_lat from mission_heartbeat_5hz message
 *
 * @return  uav纬度 = uav_lat * 1e-7
 */
static inline int32_t mavlink_msg_mission_heartbeat_5hz_get_uav_lat(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  8);
}

/**
 * @brief Get field uav_lon from mission_heartbeat_5hz message
 *
 * @return  uav点经度 = home_y_lon * 1e-7
 */
static inline int32_t mavlink_msg_mission_heartbeat_5hz_get_uav_lon(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  12);
}

/**
 * @brief Get field uav_alt from mission_heartbeat_5hz message
 *
 * @return  uav高度 = home_z_alt * 1e-3
 */
static inline int32_t mavlink_msg_mission_heartbeat_5hz_get_uav_alt(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  16);
}

/**
 * @brief Get field gps_num from mission_heartbeat_5hz message
 *
 * @return  卫星数
 */
static inline int32_t mavlink_msg_mission_heartbeat_5hz_get_gps_num(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  20);
}

/**
 * @brief Get field gps_fix from mission_heartbeat_5hz message
 *
 * @return  定位状态
 */
static inline int32_t mavlink_msg_mission_heartbeat_5hz_get_gps_fix(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  24);
}

/**
 * @brief Get field roll from mission_heartbeat_5hz message
 *
 * @return  滚转角
 */
static inline int32_t mavlink_msg_mission_heartbeat_5hz_get_roll(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  28);
}

/**
 * @brief Get field pitch from mission_heartbeat_5hz message
 *
 * @return  俯仰角
 */
static inline int32_t mavlink_msg_mission_heartbeat_5hz_get_pitch(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  32);
}

/**
 * @brief Get field yaw from mission_heartbeat_5hz message
 *
 * @return  航向角
 */
static inline int32_t mavlink_msg_mission_heartbeat_5hz_get_yaw(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  36);
}

/**
 * @brief Get field pos_x from mission_heartbeat_5hz message
 *
 * @return  ned位置
 */
static inline int32_t mavlink_msg_mission_heartbeat_5hz_get_pos_x(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  40);
}

/**
 * @brief Get field pos_y from mission_heartbeat_5hz message
 *
 * @return  ned位置
 */
static inline int32_t mavlink_msg_mission_heartbeat_5hz_get_pos_y(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  44);
}

/**
 * @brief Get field pos_z from mission_heartbeat_5hz message
 *
 * @return  ned位置
 */
static inline int32_t mavlink_msg_mission_heartbeat_5hz_get_pos_z(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  48);
}

/**
 * @brief Get field vel_x from mission_heartbeat_5hz message
 *
 * @return  ned速度
 */
static inline int32_t mavlink_msg_mission_heartbeat_5hz_get_vel_x(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  52);
}

/**
 * @brief Get field vel_y from mission_heartbeat_5hz message
 *
 * @return  ned速度
 */
static inline int32_t mavlink_msg_mission_heartbeat_5hz_get_vel_y(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  56);
}

/**
 * @brief Get field vel_z from mission_heartbeat_5hz message
 *
 * @return  ned速度
 */
static inline int32_t mavlink_msg_mission_heartbeat_5hz_get_vel_z(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  60);
}

/**
 * @brief Get field distance_mm from mission_heartbeat_5hz message
 *
 * @return  飞行距离m = distance_m * 1e-3
 */
static inline int32_t mavlink_msg_mission_heartbeat_5hz_get_distance_mm(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  64);
}

/**
 * @brief Decode a mission_heartbeat_5hz message into a struct
 *
 * @param msg The message to decode
 * @param mission_heartbeat_5hz C-struct to decode the message contents into
 */
static inline void mavlink_msg_mission_heartbeat_5hz_decode(const mavlink_message_t* msg, mavlink_mission_heartbeat_5hz_t* mission_heartbeat_5hz)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    mission_heartbeat_5hz->seq = mavlink_msg_mission_heartbeat_5hz_get_seq(msg);
    mission_heartbeat_5hz->uav_lat = mavlink_msg_mission_heartbeat_5hz_get_uav_lat(msg);
    mission_heartbeat_5hz->uav_lon = mavlink_msg_mission_heartbeat_5hz_get_uav_lon(msg);
    mission_heartbeat_5hz->uav_alt = mavlink_msg_mission_heartbeat_5hz_get_uav_alt(msg);
    mission_heartbeat_5hz->gps_num = mavlink_msg_mission_heartbeat_5hz_get_gps_num(msg);
    mission_heartbeat_5hz->gps_fix = mavlink_msg_mission_heartbeat_5hz_get_gps_fix(msg);
    mission_heartbeat_5hz->roll = mavlink_msg_mission_heartbeat_5hz_get_roll(msg);
    mission_heartbeat_5hz->pitch = mavlink_msg_mission_heartbeat_5hz_get_pitch(msg);
    mission_heartbeat_5hz->yaw = mavlink_msg_mission_heartbeat_5hz_get_yaw(msg);
    mission_heartbeat_5hz->pos_x = mavlink_msg_mission_heartbeat_5hz_get_pos_x(msg);
    mission_heartbeat_5hz->pos_y = mavlink_msg_mission_heartbeat_5hz_get_pos_y(msg);
    mission_heartbeat_5hz->pos_z = mavlink_msg_mission_heartbeat_5hz_get_pos_z(msg);
    mission_heartbeat_5hz->vel_x = mavlink_msg_mission_heartbeat_5hz_get_vel_x(msg);
    mission_heartbeat_5hz->vel_y = mavlink_msg_mission_heartbeat_5hz_get_vel_y(msg);
    mission_heartbeat_5hz->vel_z = mavlink_msg_mission_heartbeat_5hz_get_vel_z(msg);
    mission_heartbeat_5hz->distance_mm = mavlink_msg_mission_heartbeat_5hz_get_distance_mm(msg);
    mission_heartbeat_5hz->drone_type = mavlink_msg_mission_heartbeat_5hz_get_drone_type(msg);
    mission_heartbeat_5hz->drone_id = mavlink_msg_mission_heartbeat_5hz_get_drone_id(msg);
    mission_heartbeat_5hz->is_gps_invalid = mavlink_msg_mission_heartbeat_5hz_get_is_gps_invalid(msg);
#else
        uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN? msg->len : MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN;
        memset(mission_heartbeat_5hz, 0, MAVLINK_MSG_ID_MISSION_HEARTBEAT_5HZ_LEN);
    memcpy(mission_heartbeat_5hz, _MAV_PAYLOAD(msg), len);
#endif
}
